//
//  MKNetworking.h
//  Teleport
//
//  Created by xtjun on 2020/5/18.
//  Copyright © 2020 xxt. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TJUserInfo.h"
NS_ASSUME_NONNULL_BEGIN

@interface TJNetworking : NSObject


+ (instancetype)shareNetworking;
/**post 参数在body 里面 */
- (void)POST:(NSString *)url
  parameters:(nullable id)parameters
     success:(nullable void (^)(NSDictionary *responseObject, id data))success
     failure:(nullable void (^)(NSError *error))failure;



- (void)updataImageWithImage:(UIImage *)image success:(void (^)(NSDictionary * _Nonnull, id _Nonnull))success failure:(void (^)(NSError * _Nonnull))failure;



#pragma mark ---------------new------------------

/**post 参数不在body 里面 */
- (void)POSTNew:(NSString *)url
     parameters:(nullable id)parameters
        success:(nullable void (^)(NSDictionary *responseObject, id data))success
        failure:(nullable void (^)(NSError *error))failure;

- (void)GET:(NSString *)url
 parameters:(nullable id)parameters
    success:(nullable void (^)(NSDictionary *responseObject, id data))success
    failure:(nullable void (^)(NSError *error))failure;

- (void)updataImageWithUrl:(NSString *)url
                  fileData:(NSData *)fileData
                parameters:(nullable id)parameters
                   success:(nullable void (^)(NSDictionary *responseObject, id data))success
                   failure:(nullable void (^)(NSError *error))failure;

/**跟新用户信息 */
- (void)updateUserInfoAndLoading:(BOOL)isLoading success:(nullable void (^)(TJUserInfo *userInfo))success;

@end

NS_ASSUME_NONNULL_END
